package com.zhudeshuai.zhudemolist.activity;

import android.content.Intent;
import android.os.Bundle;
import android.app.Activity;
import android.view.MotionEvent;
import android.view.View;

import com.zhudeshuai.zhudemolist.R;

public class MaterialDesignActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_material_design);

        View viewById = findViewById(R.id.tv_test);
        viewById.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {

                switch (event.getAction()){
                    case MotionEvent.ACTION_DOWN:
                        v.animate().translationZ(40);
                        break;
                    case MotionEvent.ACTION_UP:
                        v.animate().translationZ(0);
                        break;
                }
                return true;
            }
        });
    }

    public static void open(Activity activity){
        activity.startActivity(new Intent(activity,MaterialDesignActivity.class));
    }

}
